package com.guigu.servicegoods.mapper;

import com.guigu.servicegoods.domain.TbSpec;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author testjava
 * @since 2020-07-08
 */
public interface TbSpecMapper extends BaseMapper<TbSpec> {

    @Select("SELECT name,options FROM tb_spec WHERE template_id IN ( SELECT\n" +
            "template_id FROM tb_category WHERE NAME=#{categoryName}) ORDER BY seq")
    public List<Map> findListByCategoryName(@Param("categoryName") String categoryName);
}
